/*Entreadas de directorio
 *Argentina 2011-09-25
 * Carlos Raffellini
--------------------------------------------
 */
#include <stdio.h>
#include <stdlib.h>

#ifndef __entrada_de_directorio_
#define __entrada_de_directorio_
struct ENTRADA_ESTANDAR83{
	unsigned char  nombre 	  [11];
	unsigned char  atributos	  ;
	unsigned char  reservado	  ;
	unsigned char  time_fine_res  ;
	unsigned short create_time	  ;
	unsigned short create_date	  ;
	unsigned short ultimo_acceso  ;
	unsigned short direccion_alta ;
	unsigned short modif_time	  ;
	unsigned short modif_date	  ;
	unsigned short direccion_baja ;
	unsigned int   tamanio	      ;
};

#endif

#ifndef __entrada_de_directorio_larga
#define __entrada_de_directorio_larga
struct ENTRADA_LARGA{
	unsigned char  secuencia		    ;
	unsigned char  cinco_caracteres [10];
	unsigned char  atributos		    ;
	unsigned char  reservados		    ;
	unsigned char  checksum			    ;
	unsigned char  seis_caracteres  [12];
	unsigned short primer_cluster       ;
	unsigned char  dos_caracteres    [4];
};

#endif

typedef struct ENTRADA_ESTANDAR83 ENTRADA83;
typedef struct ENTRADA_LARGA ENTRADA_LARGA;

#define NOM_83    0
#define NOM_LARGO 1
#define ATR_NOM_LARGO 0x0F

#define READ_ONLY 0x01
#define HIDDEN 0x02
#define SYSTEM 0x04
#define VOLUME_ID 0x08
#define DIRECTORY 0x10
#define ARCHIVE 0x20

int armar_nombre_corto(const char * nombre_corto, char *);
int armar_parte_de_nombre(const struct ENTRADA_LARGA *, char *);
